package com.wdb.modules.system.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.wdb.modules.system.domain.Dept;
import com.wdb.modules.system.domain.vo.DeptQueryCriteria;
import com.wdb.utils.PageResult;

import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

/**
 * @author: wendaobai@qq.com
 * @date: 2024/1/19 0019 9:56
 */
public interface DeptService extends IService<Dept> {
  Set<Dept> findByRoleId(Long id);

  List<Dept> findByPid(Long id);

  PageResult<Dept> findAll(DeptQueryCriteria criteria, boolean isQuery)
      throws IllegalAccessException;

  void create(Dept resources) throws Exception;

  /**
   * 删除
   *
   * @param depts
   */
  void delete(HashSet<Dept> depts) throws Exception;

  HashSet<Dept> getDeleteDepts(List<Dept> deptList, HashSet<Dept> depts);

  /**
   * 下载部门信息
   *
   * @param deptList
   * @param response
   */
  void download(List<Dept> deptList, HttpServletResponse response) throws IOException;
}
